package com.web.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import com.web.bean.Weibo_sina_dzh_bean;

import com.web.db.HibernateUtil;

public class Weibo_sina_dzh_dao{

	public void save(Weibo_sina_dzh_bean bean){
		Configuration config=new Configuration();
		SessionFactory factory = new Configuration().configure().buildSessionFactory();
		
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		Transaction tx = session.beginTransaction();		
		session.saveOrUpdate(bean);
		tx.commit();
	}
	
	
	public static void main(String[] args){
		new Weibo_sina_dzh_dao().save(new Weibo_sina_dzh_bean());
	}
}
